#!/bin/bash

system_url=/etc/rc.local
res_url=/home/sietium/env/reboot_num.txt
reboot_num=500  #需要重复开关机次数
reboot_time=30  #每次开机后多少秒后关机

m=$(cat ${res_url} | wc -l)
if (($m < $reboot_num));then
	echo 1 >> ${res_url}
	sleep $reboot_time && shutdown -r now
elif (($m >= $reboot_num));then
	sudo rm ${system_url}
	shutdown -r now
fi
